{%extends "base.html"%}

{%block body%}


<div style="clear: both;"/>	

{# Check if we have any todos, only in this case render the table #}
{% if user %}
{% if numdvds %}
 
Total de Filmes: {{numdvds}}. 

<table>
  <tr>
  
      <th>Proprietario </th>
      <th>dsTitulo</th>
      <th>dsAtorPrincipal</th>
      <th>dsDiretor</th>
      <th>dsSinopse</th>
      <th>dsUrlTraler em</th>
      <th>nuDuracao</th>
      <th>nuNota</th>
    </tr>

{% for dvd in dvds %}
<tr> 
<td>
{{dvd.Proprietario}}
</td>
<td>
{{dvd.dsTitulo}}
</td>
<td>
{{dvd.dsAtorPrincipal}}
</td>
<td>
{{dvd.dsDiretor}}
</td>
<td>
{{dvd.dsSinopse}}
</td>
<td>
{{dvd.dsUrlTraler}}
</td>
<td>
{{dvd.nuDuracao}}
</td>
<td>
{{dvd.nuNota}}
</td>
<td>
<a class="done" href="/done?id={{dvd.key.id}}" >Locar</a>
</td>
<td>
<a class="email" href="/email?id={{dvd.key.id}}" >Solicitar</a>
</td>
</tr> 
{% endfor %}
</table>

{% endif %}


<hr />



<div class="headline">Cadastrar Filme?</div>


<form action="/new" method="post">
	<table>
		<tr>
			<td><label for="shortDescription">Titulo</label></td>
			<td><input type="text" name="dsTitulo" id="dsTitulo" size="80"/></td>
		</tr>
		<tr>
			<td><label for="shortDescription">dsAtorPrincipal</label></td>
			<td><input type="text" name="dsAtorPrincipal" id="dsAtorPrincipal" size="80"/></td>
		</tr>		
		<tr>
			<td><label for="shortDescription">dsDiretor</label></td>
			<td><input type="text" name="dsDiretor" id="dsDiretor" size="80"/></td>
		</tr>				
		<tr>
			<td valign="top"><label for="dsSinopse">dsSinopse</label></td>
			<td><textarea rows="4" cols="80" name="dsSinopse" id="dsSinopse"></textarea></td>
		</tr>		
		<tr>
			<td><label for="dsUrlTraler">dsUrlTraler</label></td>
			<td><input type="text" name="dsUrlTraler" id="dsUrlTraler" size="80"/></td>
		</tr>
		<tr>
			<td><label for="nuDuracao">nuDuracao</label></td>
			<td><input type="text" name="nuDuracao" id="nuDuracao" size="30"/></td>
		</tr>		
		<tr>
			<td><label for="nuNota">nuNota</label></td>
			<td><input type="text" name="nuNota" id="nuNota" size="30"/></td>
		</tr>			
		<tr>
			<td colspan="2" align="right"><input type="submit" value="Criar"/></td>
		</tr>
	</table>
</form>

{% else %}
Logue com sua conta do google para visualizar suas tarefas.
{% endif%}

{%endblock%}